Many instances exist in which light levels in images require adjustment, such as when exposure or color balance needs to be corrected. With conventional photography development techniques, correction is accomplished in a darkroom by adjusting filter amounts on an enlarger or by increasing or decreasing the exposure time. Both of these techniques perform linear light adjustments. Each time light or time is doubled, the exposure of all the points of the image doubles regardless of the density at each point.
The response of a print or film to the above correction techniques is not linear. Instead, the response has a rather complex ‘S’ shaped characteristic curve. In an image area with the most detail or the central part of the total density range, the response is proportional to the logarithm of the image intensity. For every doubling of exposure, a constant step-wise increment in density occurs. Hence, with a step chart in which each gray patch represents a doubling of the density of its neighbor, each step change appears to be a uniform density increment relative to its neighbor.
Correction characteristics for digital cameras also have a non-linear response. However, digital cameras typically have physical limitations in the sensor dynamic range that makes the characteristic curve typically different than the ‘S’-shaped (log-linear) curve of the conventional film. This nonlinear response is encoded in the final images that digital cameras produce in image files (e.g. jpeg or tiff) or from raw image processors as output. Although the raw data reflect the direct output from the sensor and therefore are inherently linear, typical cameras or raw processing software modify this output to produce a non-linear response in the color-space used in viewers and editors. Unfortunately, the tools provided in the editors and viewers do not account for the non-linear response, thus resulting in poor color and exposure adjustments in most situations. Simple ‘gamma’ models of the response curve non-linearity result in poor approximations and are poorly suited for making accurate and visually acceptable adjustments to color or exposure.
Furthermore, current image correction techniques for digital cameras such as those used in the Adobe Photoshop software, from Adobe Systems Incorporated are based on specific camera characteristics and accordingly cannot be used universally for all digital cameras. A technique is therefore needed that is capable of image correction for images produced by any digital camera.
With regard to exposure, FIG. 8 illustrates a test chart for an under-exposed image. The test chart of FIG. 8 represents an image under-exposed by one or two f-stops. The f-stop number indicates the relative size of the opening of the lens or aperture. The number is obtained by dividing the focal length f of a lens by its effective aperture. In the conventional series, each number represents an aperture that admits half as much light as the preceding one. The test chart shown in FIG. 8 may have, for example, been two f-stops underexposed at f/5.6. The test chart of FIG. 9 showing a properly exposed image at an exposure of f/2.8. The change of the intensities of the grey patches from FIG. 8 to FIG. 9 can be seen in a comparison of the two test charts.
If the relative pixel intensities of the grey scale patches are plotted using a tool such as an Adobe Photoshop Curves tool, the relationship is illustrated as non-linear as shown in a screen shot 600 illustrated in FIG. 6. The plotting process requires measurement of each of the plotted points. The screen shot 600 illustrates a non-linear plot 604 that shows underexposed values on the x-axis 608 and properly exposed values on the y-axis 606. The illustrated curve is a lookup table and may be created for each RGB channel so that an entire image can be transformed to the correct lookup values. The Photoshop Curves tool shows the response correction for a 4× (2 stop) under-exposure. The grey-values of the under-exposed image in FIG. 8 will map to the correctly exposed values shown in FIG. 9. As set forth above, using currently existing tools, the relationship shown in FIG. 6 can only be achieved through detailed and laborious measurements.
One existing approach for the correction of under-exposure in Adobe Photoshop and other editors is end-point white level correction. FIG. 10 illustrates a test chart produced by this technique. This process results in a much different mapping than the values measured between actual exposure changes in FIG. 6. Instead, the relationship is largely linear as shown in FIG. 7. A screen shot 700 of FIG. 7 shows a plot 704 that includes underexposed values along the x-axis 708 and the corrected values on the y-axis 706. As illustrated in FIG. 10, the artifacts of end-point white level correction include the production of harshly saturated and high contrast as side effects to the attempted correction.
In addition to exposure correction, another area in which image correction is often implemented is color balance. A frequently used technique for achieving an optimal color balance in digital cameras is a white balance technique. Using white balancing, a neutral patch, or some approximation of a neutral patch such as a cloud or white shirt, is selected in the image. The individual channel color exposures (channel gain in RGB or CMY) are then adjusted in order to cause the neutral color to appear neutral.
This technique suffers from several deficiencies. For example, a single white point will not provide an optimal correction for all of the intermediate colors. FIG. 11 illustrates an incorrect white balance achieved using tungsten light with a daylight setting. FIG. 12 illustrates the result of adjusting the gain for each color channel in the image to correct for the colorcast by getting one grey point correct (third from left on the bottom row). The highlights have a blue cast (see the lower-left white patch) while the darker areas are shifted to red.
By using individual channel exposure curves obtained through measured camera characteristics, a curve similar to the curve from FIG. 6, and thus better results, can be obtained as shown in FIG. 13. However, as explained above, this process is laborious and requires multiple individual measurements.
The corrected images shown in FIGS. 9 and 13 above were hand-corrected using the Adobe Photoshop editing program. This technique is successful when many known grey-values exist. However, even though the technique is successful, it is labor intensive and often impossible due to the lack of neutral patches available for reference.
One way to solve this problem is to work with data that is in linear space where double the light means double the intensity, or a logarithmic space where each doubling of light intensity results in a constant increment of pixel value. Raw file programs like Adobe RAW, Phase One Raw products, and independent hardware vendor (IHV) proprietary raw editors such as Nikon Capture will allow adjustments in the linear space to facilitate simple gains. However, since digital cameras have typically already mapped the images to a non-linear color space by the time most photo-editors can open them, this technique is simply not feasible once the image has been converted into a viewable color space such as sRGB by the camera.
In practice, a technique is needed for obtaining a mapping similar to that shown in FIG. 6 based on a model of the camera non-linearity. Furthermore, a solution is needed that applies to all digital cameras and is accurate across the dynamic range of the camera.